package behavior.iterator;

import java.util.ArrayList;
import java.util.List;

public class InfoCollege implements College {

    List<Department> departmentList = new ArrayList<Department>();

    InfoCollege(){
        addDepartment("信息 Java专业","信息 Java专业desc");
        addDepartment("信息 Php专业","信息 Php专业desc");
        addDepartment("信息 iOS专业","信息 iOS专业desc");
    }

    @Override
    public String getName() {
        return "信息学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        departmentList.add(new Department(name,desc));
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterator(departmentList);
    }
}
